#pragma once

class GameObject;

class Camera
{
	float offsetX, offsetY;	// The camera's offset in the world.
	float scrollSpeed;		// The speed that the camera can pan around.
	int screenWidth;		// The width of the camera screen.
	int screenHeight;		// The height of the camera screen.
	int worldWidth;			// The width of the world.
	int worldHeight;		// The height of the world.

	bool isScrolling;		// Is TRUE if the camera is currently scrolling without focus on the player.

	GameObject* player;			// Gives the camera access to the player's position.
	GameObject* exitDoor;		// Gives the camera the position of the exit door.

private:
	// Constructor
	Camera(void);
	Camera(const Camera&);
	Camera& operator=(const Camera&);

	// Destructor
	~Camera(void);

	static Camera* instance;

public:

	//////////////////////////////////////////////////
	// Accessors:
	float OffsetX(void) const;
	float OffsetY(void) const;

	int ScreenWidth(void) const { return screenWidth; }
	int ScreenHeight(void) const { return screenHeight; }
	int WorldWidth(void) const { return worldWidth; }
	int WorldHeight(void) const { return worldHeight; }

	bool IsScrolling(void);

	//////////////////////////////////////////////////
	// Mutators:
	void SetPlayer(GameObject*);
	void SetExitDoor(GameObject*);
	void SetWorldWidth(int width);
	void SetWorldHeight(int height);

	//////////////////////////////////////////////////
	// Methods:
	void SkipScrolling(void);
	void Update(float deltaTime);

	static Camera* GetInstance(void);
	static void DeleteInstance(void);

};

